package com.ystarkotlin.utils

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.net.ConnectivityManager
import com.blankj.utilcode.util.NetworkUtils
import com.blankj.utilcode.util.ToastUtils

class NetBroadCastReciver : BroadcastReceiver() {

    override fun onReceive(context: Context, intent: Intent) {
            if (intent.action.equals(ConnectivityManager.CONNECTIVITY_ACTION)){
                if (!NetworkUtils.isConnected()) {
                    ToastUtils.showShort("网络未连接,请检查网络")
                    return
                } else {
                    if (!NetworkUtils.isWifiConnected()) {

                        return
                    }
                }
            }

    }
}
